package psn.zjk.common.utils;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @USER white
 * @DATETIME 2021/3/1 16:34
 */
public class FastCopy {
    public static final int THREAD_NUM=Runtime.getRuntime().availableProcessors()+1;
    public static final ThreadPoolExecutor EXEUTORS=new ThreadPoolExecutor(THREAD_NUM,THREAD_NUM,3, TimeUnit.SECONDS,new ArrayBlockingQueue<>(100), Executors.defaultThreadFactory(),
            (r, executor) -> {
                try {
                    executor.getQueue().put(r);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });

    public void copy(String sourcePattern,String targetDir){
        //找到文件
//        FileSystems.getDefault().getPathMatcher()
        //小文件多线程拷贝
        //大文件分段多线程拷贝
    }



}
